﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'usp_UPDMS_MNY_IN_OUT_MGT_Get_Balance_Amount_List')
	BEGIN
		DROP Procedure usp_UPDMS_MNY_IN_OUT_MGT_Get_Balance_Amount_List
	END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
/******************************************************************************
**	Name : usp_UPDMS_MNY_IN_OUT_MGT_Get_Balance_Amount_List
**	Desc : 생활비 차감관리
**	Test Exec Query : Exec usp_UPDMS_MNY_IN_OUT_MGT_Get_Balance_Amount_List '997,998,999', 'ko'
**	Called by : Mny_Dac_UPDMS_MNY_IN_OUT_MGT.cs
**	Program ID : Mny3012p
**	Auth : 송시명
**	Date : 2010-06-08
*******************************************************************************
**	Change History
*******************************************************************************
**	Date:		Author:		Description:
**	--------	--------	---------------------------------------
**	
*******************************************************************************/
CREATE PROC [dbo].[usp_UPDMS_MNY_IN_OUT_MGT_Get_Balance_Amount_List]
@ls_seq nvarchar(max),
@ls_lang_set nvarchar(2)
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET NOCOUNT ON

SELECT Seq,
       Reg_Dt,
       Account,
       dbo.ufn_UPDMS_Get_Code_Name(Account, 'MNY', @ls_lang_set) AS Account_Nm,
       Contents,
       Amount,
       Remark
  FROM UPDMS_MNY_IN_OUT_MGT WITH(NOLOCK)
 WHERE Seq IN (SELECT Rslt FROM dbo.ufn_UPDMS_Get_Rslt_At_Comma(@ls_seq))   
   AND Class = 'AA002'
   AND Account <> 'AC021'
   AND Reg_Dt >= CONVERT(VARCHAR(7), GETDATE(), 120) + '-01'
 ORDER BY Reg_Dt

GO